import axios from "axios";
const key = import.meta.env.VITE_APP_KEY
const request = axios.create({
  baseURL: "/map",
});
// 添加请求拦截器
request.interceptors.request.use((config) => {
  let url = config.url;

  // console.log(url)
  // console.log(key)

  if (url.includes("?")) {
    config.url = `${url}&key=${key}`;
  } else {
    config.url = `${url}?key=${key}`;
  }
  // console.log(config.url);

  return config;
});


export default request;